package com.project.easy.common.util.exception.business;

import com.project.easy.common.util.enums.exception.ExceptionEnums;
import com.project.easy.common.util.exception.BaseException;
import com.project.easy.common.util.string.StringUtil;

/**
 * @ClassName ParamRequireException
 * @Description  参数必须传
 * @Author GreatorMan.cool
 * @Date 2021/3/25 14:57
 * @Version 1.0
 **/
public class BusinessException extends BaseException {
    /**
     * 必传参数
     * @param subCode 子编码
     * @param subMsg 子消息
     */
    public BusinessException(String subCode, String subMsg) {
        super(ExceptionEnums.BUSINESS_EXCEPTION.getCode(), ExceptionEnums.BUSINESS_EXCEPTION.getName(), subCode, StringUtil.isBlank(subMsg) ? "业务异常" : subMsg);
    }

    /**
     * 参数异常
     * @param subMsg 异常消息
     */
    public BusinessException(String subMsg) {
        super(ExceptionEnums.BUSINESS_EXCEPTION.getCode(), ExceptionEnums.BUSINESS_EXCEPTION.getName(), ExceptionEnums.BUSINESS_EXCEPTION.getCode(), StringUtil.isBlank(subMsg) ? "业务异常" : subMsg);
    }

}
